import { betterAuth } from "better-auth"
import { username, admin } from 'better-auth/plugins';
import Database from "better-sqlite3"

export const auth = betterAuth({
  database: new Database("database.sqlite"),
  secret: process.env.BETTER_AUTH_SECRET,
  // baseURL: process.env.BETTER_AUTH_URL,
  emailAndPassword: {
    enabled: true,
  },
  socialProviders: {
    github: {
      clientId: process.env.GITHUB_CLIENT_ID as string,
      clientSecret: process.env.GITHUB_CLIENT_SECRET as string,
    },
  },
  plugins: [username(), admin()],
})
